home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / winfo / winfo.frm < prev    next >
Text File  |  1995-05-08  |  8KB  |  223 lines

  1. VERSION 2.00
  2. Begin Form Winfo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Winfo"
  6.    ClientHeight    =   3975
  7.    ClientLeft      =   2100
  8.    ClientTop       =   1575
  9.    ClientWidth     =   3540
  10.    FontBold        =   -1  'True
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   9.75
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   4380
  17.    Icon            =   WINFO.FRX:0000
  18.    Left            =   2040
  19.    LinkMode        =   1  'Source
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    ScaleHeight     =   3975
  23.    ScaleWidth      =   3540
  24.    Top             =   1230
  25.    Width           =   3660
  26.    Begin Timer Timer1 
  27.       Interval        =   100
  28.       Left            =   0
  29.       Top             =   3600
  30.    End
  31.    Begin CommandButton About 
  32.       Caption         =   "&About"
  33.       Height          =   375
  34.       Left            =   2040
  35.       TabIndex        =   7
  36.       Top             =   3480
  37.       Width           =   1215
  38.    End
  39.    Begin CommandButton Done 
  40.       Caption         =   "&Done"
  41.       Height          =   375
  42.       Left            =   240
  43.       TabIndex        =   6
  44.       Top             =   3480
  45.       Width           =   1215
  46.    End
  47.    Begin Label Label7 
  48.       Alignment       =   2  'Center
  49.       BackColor       =   &H00C0C0C0&
  50.       ForeColor       =   &H000000FF&
  51.       Height          =   255
  52.       Left            =   120
  53.       TabIndex        =   8
  54.       Top             =   3120
  55.       Width           =   3375
  56.    End
  57.    Begin Label Label6 
  58.       Alignment       =   2  'Center
  59.       BackColor       =   &H00C0C0C0&
  60.       ForeColor       =   &H00FF0000&
  61.       Height          =   255
  62.       Left            =   120
  63.       TabIndex        =   5
  64.       Top             =   2760
  65.       Width           =   3255
  66.    End
  67.    Begin Label Label5 
  68.       Alignment       =   2  'Center
  69.       BackColor       =   &H00C0C0C0&
  70.       ForeColor       =   &H000000FF&
  71.       Height          =   255
  72.       Left            =   120
  73.       TabIndex        =   4
  74.       Top             =   2400
  75.       Width           =   3255
  76.    End
  77.    Begin Label Label4 
  78.       Alignment       =   2  'Center
  79.       BackColor       =   &H00C0C0C0&
  80.       ForeColor       =   &H00FF0000&
  81.       Height          =   255
  82.       Left            =   120
  83.       TabIndex        =   3
  84.       Top             =   2040
  85.       Width           =   3255
  86.    End
  87.    Begin Label Label3 
  88.       Alignment       =   2  'Center
  89.       BackColor       =   &H00C0C0C0&
  90.       ForeColor       =   &H000000FF&
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   2
  94.       Top             =   1680
  95.       Width           =   3255
  96.    End
  97.    Begin Label Label2 
  98.       Alignment       =   2  'Center
  99.       BackColor       =   &H00C0C0C0&
  100.       ForeColor       =   &H00FF0000&
  101.       Height          =   255
  102.       Left            =   120
  103.       TabIndex        =   1
  104.       Top             =   1320
  105.       Width           =   3255
  106.    End
  107.    Begin Label Label12 
  108.       BackColor       =   &H00000000&
  109.       ForeColor       =   &H00000000&
  110.       Height          =   15
  111.       Left            =   120
  112.       TabIndex        =   13
  113.       Top             =   1200
  114.       Width           =   3255
  115.    End
  116.    Begin Label Label10 
  117.       BackColor       =   &H00C0C0C0&
  118.       ForeColor       =   &H0000FFFF&
  119.       Height          =   255
  120.       Left            =   2040
  121.       TabIndex        =   11
  122.       Top             =   840
  123.       Width           =   1215
  124.    End
  125.    Begin Label Label11 
  126.       BackColor       =   &H00C0C0C0&
  127.       Caption         =   "And the time is:"
  128.       ForeColor       =   &H00FF0000&
  129.       Height          =   255
  130.       Left            =   600
  131.       TabIndex        =   12
  132.       Top             =   840
  133.       Width           =   1455
  134.    End
  135.    Begin Label Label9 
  136.       Alignment       =   2  'Center
  137.       BackColor       =   &H00C0C0C0&
  138.       ForeColor       =   &H00FF00FF&
  139.       Height          =   495
  140.       Left            =   720
  141.       TabIndex        =   10
  142.       Top             =   360
  143.       Width           =   2055
  144.    End
  145.    Begin Label Label8 
  146.       BackColor       =   &H00000000&
  147.       ForeColor       =   &H00000000&
  148.       Height          =   15
  149.       Left            =   0
  150.       TabIndex        =   9
  151.       Top             =   240
  152.       Width           =   3615
  153.    End
  154.    Begin Label Label1 
  155.       BackColor       =   &H00C0C0C0&
  156.       Caption         =   "Some Information About Windows.."
  157.       FontBold        =   -1  'True
  158.       FontItalic      =   0   'False
  159.       FontName        =   "MS Serif"
  160.       FontSize        =   9.75
  161.       FontStrikethru  =   0   'False
  162.       FontUnderline   =   0   'False
  163.       ForeColor       =   &H0000FFFF&
  164.       Height          =   255
  165.       Left            =   120
  166.       TabIndex        =   0
  167.       Top             =   0
  168.       Width           =   3495
  169.    End
  170. End
  171. Declare Function RemoveMenu Lib "User" (ByVal hMenu, ByVal nPosition, ByVal wFlags)
  172. Declare Function GetSystemMenu Lib "User" (ByVal Hwnd As Integer, ByVal bRevert As Integer) As Integer
  173. Declare Function GetWinFlags Lib "Kernel" () As Long
  174.  
  175. Const WF_PMODE = &H1        'In Proteceted mode?
  176. Const WF_CPU286 = &H2       'Is it a 286?
  177. Const WF_CPU386 = &H4       'Is it a 386?
  178. Const WF_CPU486 = &H8       'Is it a 486?
  179. Const WF_STANDARD = &H10       'Standard mode?
  180. Const WF_ENHANCED = &H20       'Enhanced mode?
  181. Const WF_CPU086 = &H40             'Is it a 8086
  182. Const WF_LARGEFRAME = &H100        'LargeFrame EMS
  183. Const WF_SMALLFRAME = &H200        'SmallFrame EMS
  184. Const WF_80x87 = &H400                     'Math processer
  185.  
  186. Sub About_Click ()
  187. AboutBox.Show      'Show AboutBox
  188. Winfo.enabled = 0    'Disable the Winfo form
  189. End Sub
  190.  
  191. Sub Done_Click ()
  192. End     'I think you know what this means!
  193. End Sub
  194.  
  195. Sub Form_GotFocus ()
  196. Done.SetFocus     'When focus goes back to Winfo form, make Done the active button
  197. End Sub
  198.  
  199. Sub Form_Load ()
  200. Move (Screen.width - width) \ 2, (Screen.height - height) \ 2    'Center form
  201. Dim WinFlags As Long
  202. WinFlags = GetWinFlags()
  203. If WinFlags And WF_ENHANCED Then label2.caption = "You are in Enhanced mode." Else If WinFlags And WF_STANDARD Then label2.caption = "You are in Standard mode."
  204. If WinFlags And WF_CPU386 Then label3.caption = "Your CPU is a 386." Else If WinFlags And WF_CPU286 Then label3.caption = "Your CPU is a 286." Else If WinFlags And WF_CPU486 Then label3.caption = "Your CPU is a 486."
  205. If WinFlags And WF_CPU086 Then label3.caption = "Your CPU is a 8086."
  206. If WinFlags And WF_LARGEFRAME Then label4.caption = "Lagre Frame EMS  is active." Else label4.caption = "Small Frame EMS is active."
  207. If WinFlags And WF_80x87 Then label5.caption = "Math Co-processor  present." Else label5.caption = "Math Co-processor not present."
  208. If WinFlags And WF_PMODE Then label7.caption = "Protected Mode - Enabled." Else label7.caption = "Protected Mode - Disabled."
  209. label6.caption = Format$(GetFreeSpace(0) \ 1024) + " KB of free Memory."
  210. GetDate
  211.  
  212. End Sub
  213.  
  214. Sub GetDate ()
  215. Today# = Now       'Get date string and covert it to a standard format.
  216. label9.caption = "Today is " + Format$(Today#, "dddd,  mmmm dd,  yyyy") + " . "
  217. End Sub
  218.  
  219. Sub Timer1_Timer ()
  220. label10.caption = Time$      'Put the current Time on form and keep it going.
  221. End Sub
  222.  
  223.